package com.t235.gc.goods.service;

import com.t235.gc.entity.Goods;
import com.t235.gc.goodsvo.GoodsAndDeviceVo;
import com.t235.gc.mapper.GoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsService {
    @Autowired
    GoodsMapper goodsMapper;

    public List<GoodsAndDeviceVo> FindByGoodsAndDeviceVo(Integer isstock, Integer isfault){
        return goodsMapper.FindByGoodsAndDeviceVo(isstock,isfault);
    }
    public List<Goods> FindByGoodsCategoryId(Long goodscategoryid){
        return goodsMapper.FindByGoodsCategoryId(goodscategoryid);
    }
    public int updateByPrimaryKeySelective(Goods goods){
        return goodsMapper.updateByPrimaryKeySelective(goods);
    }

    public int insertSelective(Goods goods){
        return goodsMapper.insertSelective(goods);
    }

    public List<Goods> FindByAll(Goods goods){
        return goodsMapper.FindByAll(goods);
    }
    public int deleteByPrimaryKey(Long goodsid){
        return goodsMapper.deleteByPrimaryKey(goodsid);
    }
    public int updateByIsoff(Goods goods){
        //商品上下架
        return goodsMapper.updateByIsoff(goods);
    }
}
